
from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static

from rest_framework.documentation import include_docs_urls

from blog.views import (
            IndexView,
        )


urlpatterns = [
    path('admin/', admin.site.urls),

    # my blog
    path('blog/', include(('blog.urls', 'blog'), namespace='blog')),
    path('', IndexView.as_view(), name='index'),

    # markdown
    path('mdeditor/', include(('mdeditor.urls', 'mdeditor'), namespace='mdeditor')),

    # restful-api
    path('docs/', include_docs_urls(title='API Docs')),

    path('search/', include('haystack.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
    import debug_toolbar
    urlpatterns = [
        path('__debug__/', include(debug_toolbar.urls))
    ] + urlpatterns
